package lastcontrnt.jmap;

import java.util.ArrayList;
import java.util.List;

/**
 * -Xms60m -Xmx60m -XX:SurvivorRatio=8 -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=D:\
 *
 * 手动生成dump文件 jmap -dump:format=b.file=<filename.hprof> <pid>
 *               jmap -dump:live,format=b.file=<filename.hprof> <pid>
 */
public class JmapTest {
    public static void main(String[] args) {
        List<byte[]> list = new ArrayList<>();
        for(int i = 0;i<1000;i++){
            //100kB
            byte[] arr = new byte[100*1024];
            list.add(arr);
            try {
                Thread.sleep(100);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
